﻿@model pcObjectLibrary.CompanyObjLibrary
@*@{
    ViewBag.Title = "Update Company";
}
<hgroup class="title">
    <h1>@ViewBag.Title.</h1>
    <h2>@Html.Raw((string)ViewBag.Message)</h2>
</hgroup>
<hr />*@
@using (Html.BeginForm("Edit", "Employer", null, FormMethod.Post, new { enctype = "multipart/form-data", id="imgForm" }))
{
       @Html.AntiForgeryToken()
    @Html.HiddenFor(x => x.companyId)
    <ul class="commonForm">
        <li>@Html.LabelFor(x => x.name)
            @Html.TextBoxFor(x => x.name)
            @Html.ValidationMessageFor(x => x.name)
        </li>
        <li>
            @Html.LabelFor(x => x.summury)
            @Html.TextAreaFor(x => x.summury, new { style = "width: 382px; height: 75px;" })
            @Html.ValidationMessageFor(x => x.summury)
        </li>
        <li>
            @Html.LabelFor(x => x.logoUrl)

            @if (Model.logoBinary != null)
            {
                string imageBase64 = Convert.ToBase64String(Model.logoBinary);
                string imageSrc = string.Format("data:image/gif;base64,{0}", imageBase64);
                <img src="@imageSrc"  />
            }
            <br />
            <input id="fileUploader" type="file" name="logo" accept="image/*;capture=camera" style="margin-left:250px;"/>
            @* @Html.TextBoxFor(x => x.logoUrl)*@
            @Html.ValidationMessageFor(x => x.logoUrl)
        </li>
        <li>
            @Html.LabelFor(x => x.deltaPunchTime, new { title = "5 minutes default" })
            @Html.TextBoxFor(x => x.deltaPunchTime, new { title = "5 minutes default", type = "number", min = -10, max = 10, value = 1 })
            @Html.ValidationMessageFor(x => x.deltaPunchTime)
        </li>
    </ul>
    <input type="submit" value="Update" class="k-button" />
}